/*
 Note: Challenge this application with Postman (https://www.postman.com/downloads/)
*/

using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Selector.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

namespace Selector.Controllers {
  public class HomeController : Controller {
    private readonly ILogger<HomeController> _logger;

    public HomeController(ILogger<HomeController> logger) {
      _logger = logger;
    }

    public IActionResult Index() {
      return View();
    }

    public IActionResult Privacy() {
      return View();
    }

    [ActionName("CurrentTime")]
    public string GetCurrentTime() {
      return DateTime.Now.ToString("T");
    }

    [NonAction]
    public string NonActionMethod() {
      return "This is not an action";
    }

    [HttpGet]
    public string GetMethod() {
      return "This is GetMethod";
    }

    [HttpPost]
    public string PostMethod() {
      return "This is PostMethod";
    }

    [HttpGet]
    [HttpPost]
    public string GetPostMethod() {
      return "This is Get and Post Method";
    }


    [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
    public IActionResult Error() {
      return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
    }
  }
}
